<?php $ui = $this->load->library('Ui'); ?>

    <h2>List of Pages</h2>
<?php 
	$header = $ui->makeOption('<a href="#" rel="#overlay">Get Help With This Page</a>' . ' '.
					anchor('pages/admin', 'Manage Pages') . ' '.
					anchor('pages/admin/add', 'Add a Page'). ' ', 1 ).
					'<div class="clear"></div>';
	$content = '<table cellspacing="1" cellpadding="5" width="100%">
					<tr class="head"><th>Page name</th><th width="120px">Show on front navigation</th><th width="100px">Navigation order</th><th width="70px">Actions</th></tr>';

	foreach($list as $var => $value)
	{		
		$edit = base_url()."static/_css/images/icons/pencil.png";
		$delete = base_url()."static/_css/images/icons/delete.png";
		$world = base_url()."static/_css/images/icons/world.png";
        $title = $value['title'];
	
       $content .='<tr><td>'.$value['title'].'.</td>';
       if ( $front_navigation[$title]['front_nav'] >= 1) { $content .= "<td>Yes</td>"; } else { $content .= "<td>No</td>"; }
       $content .= '<td>'.$navigation_order[$title]['navigation_order'].'</td>';
       $content .= '<td>'.anchor('pages/admin/edit/'.$value['id'], '<img src="'.$edit.'" />').' '.anchor('pages/admin/delete/'.$value['id'], '<img src="'.$delete.'" />').' '.anchor($value['link'], '<img src="'.$world.'" />').'</td>';
       $content .= '</tr>';
	}	
	$content .='</table>';

	
	echo $ui->makeDialog('List of Pages'.$header,$content,'maximize center');
?>

<div class="overlay" id="overlay">
	<!-- here is the content for overlay, can be anything -->
	<h2 style="margin:10px 0">Help! <em>Managing Pages.</em></h2>
	<p>
			<strong>Manage Pages</strong><br />
			<span class="help">This allows you to add, delete, and edit pages on your website.</span><br /><br />
			<strong>Add Page</strong><br />
			<span class="help">This allows you to add a new page to your website, automatically adding it to your website's menu.</span><br /><br />
			<strong>Edit Page</strong><br />
			<span class="help">This allows you to Edit a page's content.</span><br /><br />
			<strong>Delete Page</strong><br />
			<span class="help">This allows you to Delete a page.</span><br /><br />
			
	</p>
</div>
